package com.example.publishDemo.Service.Impl;

import com.example.publishDemo.Mapper.TagMapper;
import com.example.publishDemo.Model.Tag;
import com.example.publishDemo.Service.TagService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class TagServiceImpl implements TagService {
    @Resource
    TagMapper tagMapper;

    @Override
    public List<Tag> getAll() {
        return tagMapper.getAll();
    }

    @Override
    public boolean isFocus(int u_id, int t_id) {
        Tag focus = tagMapper.isFocus(u_id, t_id);
        if (focus != null) {
            return true;
        }
        return false;
    }

    @Override
    public int allPeople(int t_id) {
        return tagMapper.allPeople(t_id);
    }

    @Override
    public int allArticle(String name) {
        return tagMapper.allArticle(name);
    }

    @Override
    public int unstar(int u_id, int t_id) {
        return tagMapper.unstar(u_id,t_id);
    }

    @Override
    public int star(int u_id, int t_id) {
        return tagMapper.star(u_id,t_id);
    }
}
